import java.io.*;
import java.util.Scanner;

public class UserInterfaceContent {

	private BufferedReader dataReader, coreReader;
	private Scanner scanner, scannerTwo;
	private String output;
	private String[] inputFiles;

	UserInterfaceContent(String[] files) {
		inputFiles = files;
	}

	public String createOutput() {
		output = "DATA AND PROGRAM:" + '\n';
		try {
			coreReader = new BufferedReader(new FileReader(inputFiles[0]));
			dataReader = new BufferedReader(new FileReader(inputFiles[1]));
			scanner = new Scanner(dataReader);
			while (scanner.hasNextLine()) {
				output = output + scanner.nextLine() + '\n';
			}

			output = output + "--------------" + '\n';

			scannerTwo = new Scanner(coreReader);
			while (scannerTwo.hasNextLine()) {
				output = output + scannerTwo.nextLine() + '\n';
			}
			scanner.close();
			scannerTwo.close();

		} catch (Exception e) {
			System.out.println(e);
			System.exit(1);
		}

		return output;
	}
}
